package com.qfedu.tantu.controller;


import com.qfedu.tantu.dto.ArticleCommentAddDto;
import com.qfedu.tantu.service.intf.ArticleCommentService;
import com.qfedu.tantu.vo.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;


@RestController
@Api
@RequestMapping("/api/articleComment/")
@CrossOrigin
public class ArticleCommentController {
    @Resource
    private ArticleCommentService service;

    @GetMapping("all.do")
    public R all(int articleId){
        return service.queryByArticleId(articleId);
    }

    @PostMapping("save.do")
    public R save(@RequestBody ArticleCommentAddDto dto, HttpServletRequest request){
        return service.save(dto,request.getIntHeader("bbtoken"));
    }
}
